package cn.lystudio.rohmtimeopwide_background_v11.service.impl;

import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import cn.lystudio.rohmtimeopwide_background_v11.entity.po.SSD2MoldRecordPO;
import cn.lystudio.rohmtimeopwide_background_v11.entity.vo.Capa4ExcelVO;
import cn.lystudio.rohmtimeopwide_background_v11.entity.vo.ExcelDataVO;
import cn.lystudio.rohmtimeopwide_background_v11.entity.vo.OpUserFullNameVO;
import cn.lystudio.rohmtimeopwide_background_v11.entity.vo.TimeRecord4ExcelVO;
import cn.lystudio.rohmtimeopwide_background_v11.service.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Lazy;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;


@Service
@Slf4j
public class AllDBTimeRecordServiceImpl implements AllDBTimeRecordService {
	private ShiftCapacityRecordService shiftCapacityRecordService;
	private RecordService recordService;
	private SSD2MoldRecordService ssd2MoldRecordService;

	@Autowired
	public void setSsd2MoldRecordService(SSD2MoldRecordService ssd2MoldRecordService) {
		this.ssd2MoldRecordService = ssd2MoldRecordService;
	}

	@Autowired
	@Lazy
	public void setShiftCapacityRecordService(ShiftCapacityRecordService shiftCapacityRecordService) {
		this.shiftCapacityRecordService = shiftCapacityRecordService;
	}
	@Autowired
	@Lazy
	public void setRecordService(RecordService recordService) {
		this.recordService = recordService;
	}

	@Override
	public ExcelDataVO getExcelDate(String machineNo, String selectedDate) {
		ExcelDataVO excelDataVO = new ExcelDataVO();
		// 2.1 计算下一天的日期
		Date nextDay = DateUtil.offsetDay(DateUtil.parse(selectedDate), 1);
		String nextDayStr = DateUtil.format(nextDay, "yyyy-MM-dd");
		// 3.获取白班夜班OP姓名数据
		// 3.1 白班
		OpUserFullNameVO dayOP = recordService.getOpUserFullName(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 07:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 19:00:00"))), "yyyy-MM-dd HH:mm:ss"));
		if (ObjectUtil.isEmpty(dayOP)) {
			excelDataVO.setDayUserFullName("");
		} else {
			excelDataVO.setDayUserFullName(dayOP.getUserFullName().replace(" JAC", ""));
		}
		// 3.2 夜班
		OpUserFullNameVO nightOP = recordService.getOpUserFullName(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 19:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 07:00:00"))), "yyyy-MM-dd HH:mm:ss"));
		if (ObjectUtil.isEmpty(nightOP)) {
			excelDataVO.setNightUserFullName("");
		} else {
			excelDataVO.setNightUserFullName(nightOP.getUserFullName().replace(" JAC", ""));
		}

		// 1.获取产量数据
		excelDataVO.setCapa4ExcelVO(shiftCapacityRecordService.getCapa4Excel(machineNo, selectedDate));
		// 2.获取时间管理数据
		//excelDataVO.setTimeRecord7(recordService.getTimeRecord(machineNo,
		//		DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 07:00:00"))), "yyyy-MM-dd HH:mm:ss"),
		//		DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 08:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		//);

		ExecutorService cachedThreadPool = Executors.newCachedThreadPool();

		CompletableFuture<Void> cf7 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord7(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 07:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 08:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		},cachedThreadPool);

		CompletableFuture<Void> cf8 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord8(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 08:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 09:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf9 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord9(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 09:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 10:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf10 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord10(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 10:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 11:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf11 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord11(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 11:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 12:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf12 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord12(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 12:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 13:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf13 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord13(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 13:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 14:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf14 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord14(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 14:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 15:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf15 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord15(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 15:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 16:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf16 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord16(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 16:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 17:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf17 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord17(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 17:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 18:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf18 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord18(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 18:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 19:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf19 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord19(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 19:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 20:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf20 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord20(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 20:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 21:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf21 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord21(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 21:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 22:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf22 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord22(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 22:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 23:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf23 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord23(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 23:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 00:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cf24 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecord24(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 00:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 01:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cfB1 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecordB1(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 01:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 02:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cfB2 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecordB2(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 02:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 03:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cfB3 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecordB3(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 03:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 04:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cfB4 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecordB4(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 04:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 05:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cfB5 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecordB5(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 05:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 06:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture<Void> cfB6 = CompletableFuture.runAsync(() -> {
			excelDataVO.setTimeRecordB6(recordService.getTimeRecord(machineNo,
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 06:00:00"))), "yyyy-MM-dd HH:mm:ss"),
					DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 07:00:00"))), "yyyy-MM-dd HH:mm:ss"))
			);
		}, cachedThreadPool);

		CompletableFuture.allOf(cf7, cf8, cf9, cf10, cf11, cf12, cf13, cf14, cf15, cf16, cf17, cf18, cf19,cf20,cf21,cf22,cf23,cf24,cfB1,cfB2,cfB3,cfB4,cfB5,cfB6).join();
		cachedThreadPool.shutdown();
		/*
		excelDataVO.setTimeRecord8(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 08:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 09:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord9(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 09:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 10:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord10(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 10:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 11:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord11(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 11:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 12:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord12(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 12:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 13:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord13(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 13:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 14:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord14(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 14:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 15:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord15(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 15:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 16:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord16(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 16:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 17:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord17(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 17:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 18:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord18(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 18:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 19:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord19(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 19:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 20:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord20(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 20:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 21:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord21(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 21:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 22:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord22(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 22:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 23:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);


		excelDataVO.setTimeRecord23(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, selectedDate, " 23:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 00:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecord24(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 00:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 01:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecordB1(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 01:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 02:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecordB2(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 02:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 03:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecordB3(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 03:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 04:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecordB4(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 04:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 05:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecordB5(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 05:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 06:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		excelDataVO.setTimeRecordB6(recordService.getTimeRecord(machineNo,
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 06:00:00"))), "yyyy-MM-dd HH:mm:ss"),
				DateUtil.format(DateUtil.date(DateUtil.parse(StrUtil.concat(false, nextDayStr, " 07:00:00"))), "yyyy-MM-dd HH:mm:ss"))
		);
		*/

		// 3.获取SSD2金型数据
		excelDataVO.setSsd2MoldRecordList(ssd2MoldRecordService.getSSD2MoldRecordList(machineNo, selectedDate));
		return excelDataVO;
	}
}
